<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
	<head>
		<title>后台管理登陆</title>
		<link rel="stylesheet" type="text/css"
			href="${pageContext.request.contextPath }/styles/1/alogin.css" />
		<script type="text/javascript"
			src="${pageContext.request.contextPath }/js/jquery-1.8.2.min.js"></script>
		<script type="text/javascript"
			src="${pageContext.request.contextPath }/js/jquery.validate.js"></script>
		<script type="text/javascript">
			$(function(){
				$("form").validate({
					focusCleanup:true,
					errorElement:"span",
					success:"right",
					onkeyup:false,
					errorPlacement:function(error,element){
						$(element).next().html(error);
					},
					rules:{
						"account.aloginName":{
							required:true,
							rangelength:[4,10]
						},
						"account.apassword":{
							required:true,
							rangelength:[4,16]
						},
						"code":{
							required:true,
							number:true,
							maxlength:[4],
							minlength:[4],
							remote:"LoginAction_checkCode.action"
						}
					},
					messages:{
						"account.aloginName":{
							required:"不能为空",
							rangelength:"{0}到{1}之间"
						},
						"account.apassword":{
							required:"不能为空",
							rangelength:"{0}到{1}之间"
						},
						"code":{
							required:"不能为空",
							number:"输入数字",
							maxlength:"输入4位",
							minlength:"输入4位",
							remote:"输入错误"
						}
					}
				});
			});
		</script>
	</head>
	<body>
		<div id="main">
			<div id="login">
				<form
					action="${pageContext.request.contextPath }/LoginAction_login.action"
					name="loginForm" method="post">
					<ul>
						<li>
							<input type="text" name="account.aloginName" id="name" /><span></span>
						</li>
						<li>
							<input type="password" name="account.apassword" id="password" /><span></span>
						</li>
						<li>
							<input type="text" name="code" id="code" /><span></span>
							<img src="${pageContext.request.contextPath }/image.jsp"
								alt="code"
								onclick="javascript:this.src='${pageContext.request.contextPath }/image.jsp?tm='+Math.random()" />
						</li>
						<li>
							<input type="submit" value="登陆" id="submit" />
						</li>
					</ul>
				</form>
				<span id="err" style="color: red;">${err } </span>
			</div>

		</div>
	</body>
</html>
